/**********************************
 * @Author: Qi Hang
 * @LastEditor: Qi Hang
 * @LastEditTime: 20:23:59, 星期日 18, 五月 2025
 * @Email: wqwzxwzx@gmail.com
 * Copyright © 2023 Qi Hang | https://hanghang.xyz
 **********************************/
export function createPageLoadingGuard(router) {
  router.beforeEach(() => {
    $loadingBar.start();
  });

  router.afterEach(() => {
    setTimeout(() => {
      $loadingBar.finish();
    }, 200);
  });

  router.onError(() => {
    $loadingBar.error();
  });
}
